<template>
	<view :class="['my-cell-item', {'my-cell-item-high': message}]">
		<view class="aside-left">
			<view class="title">
				<text>{{ title }}</text>
				<text v-if="require" class="require"> *</text>
			</view>
			<view v-if="message" class="message">{{ message }}</view>
		</view>
		<view class="aside-right">
			<slot></slot>
			<u-icon v-if="arrowRight" class="arrow-right" name="arrow-right" size="30rpx" color="#666" bold></u-icon>
		</view>
	</view>
</template>

<script lang="ts" setup>
	defineProps({
		title: {
			type: String,
			default: '',
			required: true,
		},
		message: {
			type: String,
			default: '',
		},
		require: {
			type: Boolean,
			default: false,
		},
		arrowRight: {
			type: Boolean,
			default: true,
		},
	});
</script>

<style lang="scss" scoped>
	.my-cell-item {
		width: 100%;
		height: 100rpx;
		margin: auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #FFFFFF;
		box-sizing: border-box;
		border-bottom: 1rpx solid #f4f5f8;
		&:nth-last-child(1) {
			border-bottom: 0;
		}
		.title {
			line-height: 28rpx;
			font-size: 28rpx;
			font-weight: 400;
			color: #242424;
		}
		.require {
			color: #EE0000;
		}
		.message {
			line-height: 20rpx;
			font-size: 20rpx;
			font-weight: 400;
			color: #707070;
			margin-top: 16rpx;
		}
		.aside-right {
			display: flex;
			align-items: center;
		}
		.arrow-right {
			margin-left: 28rpx;
		}
	}
	.my-cell-item-high {
		height: 130rpx !important;
	}
</style>